package com.mujie.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;


@Controller
public class RestFulController {

    @PostMapping("/add/{a}/{b}")
    public String add(@PathVariable int a, @PathVariable int b, Model model) {
        int num = a + b;

        model.addAttribute("msg", "add 方法2 结果为：" + num);

        return "hello";
    }

    @GetMapping("/add/{a}/{b}")
    public String add2(@PathVariable String a, @PathVariable String b, Model model) {
        String num = a + b;

        model.addAttribute("msg", "add 方法2 结果为：" + num);

        return "hello";
    }
}
